<template>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
  <el-form-item label="缺勤占比">
    <el-input v-model="formInline.absent_score" placeholder="缺勤"></el-input>
  </el-form-item>
  <el-form-item label="期中占比">
    <el-input v-model="formInline.mid_weight" placeholder="期中占比"></el-input>
  </el-form-item>
  <el-form-item label="期末占比">
    <el-input v-model="formInline.final_weight" placeholder="期末占比"></el-input>
  </el-form-item>
  <el-form-item label="平时占比">
    <el-input v-model="formInline.homework_weight" placeholder="平时占比"></el-input>
  </el-form-item>


  <el-form-item>
    <el-button type="primary" @click="onSubmit">保存</el-button>
  </el-form-item>
</el-form>
</template>

<script>
import api from '../tool/user'
export default {
  name: "scoreWeight",
  props:['courseid'],//课程主键
  data() {
      return {
        formInline: {
          absent_score: '',
          mid_weight: '',
          final_weight: '',
          homework_weight: ''
        },
        course_id: this.courseid
      }
    },
    methods: {
      onSubmit() {
        api.saveWeight(this.$data);//保存权重,data中包含主键
        console.log(this.formInline);
      }
    }
}
</script>

<style scoped>

</style>
